package com.caiyj.observe.demo3;

import java.util.Observable;
import java.util.Observer;

/**
 * @Description:
 * @author:CAIYJ
 * @Date:2018/12/14 20:46
 */
public class ConcreteObserver implements Observer {

    public ConcreteObserver(Observable observable) {
        observable.addObserver(this);
    }

    @Override
    public void update(Observable o, Object arg) {
        System.out.println("收到通知:" + ((ConcreteSubject) o).getMess());
    }
}
